import request from '@/utils/request'


// 新增
export function addProject(data) {
  return request({
    url: '/project/projectInfo/save',
    method: 'post',
    data: data
  })
}


// 新增
export function addSaleProject(data) {
  return request({
    url: '/project/projectInfo/saleProject/save',
    method: 'post',
    data: data
  })
}


// 分页查询
export function listProject(query) {
  return request({
    url: '/project/projectInfo/list',
    method: 'get',
    params: query
  })
}

export function listProjectSalePage(query) {
  return request({
    url: '/project/projectInfo/saleList',
    method: 'get',
    params: query
  })
}


// 分页查询
export function getCompeleteMoney(query) {
  return request({
    url: '/project/projectInfo/getCompeleteMoney',
    method: 'get',
    params: query
  })
}

// 分页查询
export function getMoneyRankPage(query) {
  return request({
    url: '/project/allocationDetail/getMoneyRankPage',
    method: 'get',
    params: query
  })
}

export function appListProject(query) {
  return request({
    url: '/project/projectInfo/appListProject',
    method: 'get',
    params: query
  })
}


//获取消息提醒
export function getMessage(query) {
  return request({
    url: '/project/projectInfo/getMessage',
    method: 'get',
    params: query
  })
}




// 分页查询
export function allocationList(query) {
  return request({
    url: '/project/projectInfo/allocationList',
    method: 'get',
    params: query
  })
}


//查询我的项目处于各个阶段的有哪些
export function getMyListProcessing() {
  return request({
    url: '/project/projectInfo/myListProcessing',
    method: 'get',
  })
}


//查询配合项目
export function getAssistList(query) {
  return request({
    url: '/project/projectInfo/getAssistList',
    method: 'get',
    params: query
  })
}



//查询我发起的项目
export function myProject(query) {
  return request({
    url: '/project/projectInfo/myCreateList',
    method: 'get',
    params: query
  })
}

//查询我参与的项目
export function myJoinProject(query) {
  return request({
    url: '/project/projectInfo/myJoinList',
    method: 'get',
    params: query
  })
}


//待收款项目
export function waitPayment(query) {
  return request({
    url: '/project/projectInfo/waitPayment',
    method: 'get',
    params: query
  })
}

//超期项目
export function overTimeList(query) {
  return request({
    url: '/project/projectInfo/overTimeList',
    method: 'get',
    params: query
  })
}

//待竣工项目
export function getImplementDataView(query) {
  return request({
    url: '/project/projectInfo/getImplement',
    method: 'get',
    params: query
  })
}

//年度项目汇总
export function getAllProjectYear(query) {
  return request({
    url: '/project/projectInfo/allProjectYear',
    method: 'get',
    params: query
  })
}



//排行榜
export function getRank(query) {
  return request({
    url: '/project/projectInfo/rank',
    method: 'get',
    params: query
  })
}



//待收质保项目
export function getWarrantyList(query) {
  return request({
    url: '/project/projectInfo/warrantyList',
    method: 'get',
    params: query
  })
}



//数据面板 第一个板块
export function getFirstPanelByYear(query) {
  return request({
    url: '/project/projectInfo/firstPanel',
    method: 'get',
    params: query
  })
}

//数据面板 柱状图
export function getProjectStatus(query) {
  return request({
    url: '/project/projectInfo/projectStatus',
    method: 'get',
    params: query
  })
}

//数据面板 饼图
export function getPieData(query) {
  return request({
    url: '/project/projectInfo/pieData',
    method: 'get',
    params: query
  })
}

//数据面板 折线图
export function getLineData(query) {
  return request({
    url: '/project/projectInfo/lineData',
    method: 'get',
    params: query
  })
}



export function myJoinListCount(query) {
  return request({
    url: '/project/projectInfo/myJoinListCount',
    method: 'get',
    params: query
  })
}

export function getAllDetail(query) {
  return request({
    url: '/project/projectInfo/getAllDetail',
    method: 'get',
    params: query
  })
}




//核算中的项目
export function myAccountingList(query) {
  return request({
    url: '/project/projectInfo/myAccountingList',
    method: 'get',
    params: query
  })
}

//查询需我处理的项目
export function needHandle(query) {
  return request({
    url: '/project/projectInfo/needHandle',
    method: 'get',
    params: query
  })
}




//查询详细信息
export function getProject(id) {
  return request({
    url: '/project/projectInfo/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

//查询详细信息
export function saleDetails(id) {
  return request({
    url: '/project/projectInfo/saleDetails',
    method: 'get',
    params: { id: id } // 查询参数
  });
}


//判断收款
export function checkMoney(id) {
  return request({
    url: '/project/projectInfo/checkMoney',
    method: 'get',
    params: { id: id } // 查询参数
  });
}


//查询统计信息
export function getResults(id) {
  return request({
    url: '/project/projectInfo/getResult',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updateProject(data) {
  return request({
    url: '/project/projectInfo/update',
    method: 'put',
    data: data
  })
}

// 修改
export function updateSaleProject(data) {
  return request({
    url: '/project/projectInfo/saleProject/update',
    method: 'put',
    data: data
  })
}

//删除
export function delProject(id) {
  return request({
    url: '/project/projectInfo/' + id,
    method: 'delete'
  })
}


export function syncData() {
  return request({
    url: '/project/company/sqlserver',
    method: 'get',
  })
}


// export function syncData() {
//   return request({
//     url: '/project/company/syncSale',
//     method: 'get',
//   })
// }

// export function syncData() {
//   return request({
//     url: '/project/company/syncStore',
//     method: 'get',
//   })
// }


// export function syncData() {
//   return request({
//     url: '/project/company/syncGoods',
//     method: 'get',
//   })
// }

// export function syncData() {
//   return request({
//     url: '/project/company/syncData',
//     method: 'get',
//   })
// }

// 分页查询
export function getCompanyList() {
  return request({
    url: '/project/company/list',
    method: 'get',
  })
}

//
// 分页查询
export function listCompany(query) {
  return request({
    url: '/project/company/listByName',
    method: 'get',
    params: query
  })
}

// 分页查询
export function getFinanceList() {
  return request({
    url: '/project/company/finance',
    method: 'get',
  })
}





// 新增
export function addParticipan(data) {
  return request({
    url: '/project/participan/save',
    method: 'post',
    data: data
  })
}

// 新增
export function autoAddPerson(data) {
  return request({
    url: '/project/participan/autoAddPerson',
    method: 'post',
    data: data
  })
}



// 查询
export function listParticipan(query) {
  return request({
    url: '/project/participan/list',
    method: 'get',
    params: query
  })
}

export function checkSale(query) {
  return request({
    url: '/project/participan/checkSale',
    method: 'get',
    params: query
  })
}


export function getAllSaleRole(query) {
  return request({
    url: '/project/participan/getSaleRole',
    method: 'get',
    params: query
  })
}


export function getAllSaleRoleXs(query) {
  return request({
    url: '/project/participan/getSaleRoleXS',
    method: 'get',
    params: query
  })
}


// 分页查询
export function getPermission(query) {
  return request({
    url: '/project/participan/getPermission',
    method: 'get',
    params: query
  })
}

export function getPermissionSaleAndManage(query) {
  return request({
    url: '/project/participan/getPermissionSaleAndManage',
    method: 'get',
    params: query
  })
}


export function getPermissionIndex(query) {
  return request({
    url: '/project/participan/indexPermisson',
    method: 'get',
    params: query
  })
}


// 分页查询
export function getPostPermissions(query) {
  return request({
    url: '/project/participan/getPostPermission',
    method: 'get',
    params: query
  })
}



//查询详细信息
export function getParticipan(id) {
  return request({
    url: '/project/participan/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updateParticipan(data) {
  return request({
    url: '/project/participan/update',
    method: 'put',
    data: data
  })
}

//删除
export function delParticipan(id) {
  return request({
    url: '/project/participan/' + id,
    method: 'delete'
  })
}









// 新增
export function addAttachment(data) {
  return request({
    url: '/project/attachment/save',
    method: 'post',
    data: data
  })
}

// 分页查询
export function listAttachment(query) {
  return request({
    url: '/project/attachment/list',
    method: 'get',
    params: query
  })
}



//查询详细信息
export function getAttachment(id) {
  return request({
    url: '/project/attachment/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updateAttachment(data) {
  return request({
    url: '/project/attachment/update',
    method: 'put',
    data: data
  })
}

//删除
export function delAttachment(id) {
  return request({
    url: '/project/attachment/' + id,
    method: 'delete'
  })
}






// 新增
export function addPay(data) {
  return request({
    url: '/project/pay/save',
    method: 'post',
    data: data
  })
}

// 分页查询
export function listPay(query) {
  return request({
    url: '/project/pay/list',
    method: 'get',
    params: query
  })
}



//查询详细信息
export function getPay(id) {
  return request({
    url: '/project/pay/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updatePay(data) {
  return request({
    url: '/project/pay/update',
    method: 'put',
    data: data
  })
}

export function updateIds(data) {
  return request({
    url: '/project/pay/updateIds',
    method: 'put',
    data: data
  })
}


//删除
export function delPay(id) {
  return request({
    url: '/project/pay/' + id,
    method: 'delete'
  })
}




// 新增
export function addPhase(data) {
  return request({
    url: '/project/phase/save',
    method: 'post',
    data: data
  })
}

// 分页查询
export function listPhase(query) {
  return request({
    url: '/project/phase/list',
    method: 'get',
    params: query
  })
}

//获取步骤条
export function getStepList(query) {
  return request({
    url: '/project/phase/getStepList',
    method: 'get',
    params: query
  })
}

//获取收款信息
export function getAmountInfo(id) {
  return request({
    url: '/project/projectInfo/getAmountInfo',
    method: 'get',
    params: {
      projectNo: id
    }
  })
}


// 分页查询
export function getStatus(query) {
  return request({
    url: '/project/phase/getStatus',
    method: 'get',
    params: query
  })
}


//查询详细信息
export function getPhase(id) {
  return request({
    url: '/project/phase/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updatePhase(data) {
  return request({
    url: '/project/phase/update',
    method: 'put',
    data: data
  })
}

// 环节回退
export function rollBackPhase(data) {
  return request({
    url: '/project/phase/rollBackPhase',
    method: 'post',
    data: data
  })
}

//删除
export function delPhase(id) {
  return request({
    url: '/project/phase/' + id,
    method: 'delete'
  })
}











// 新增
export function addImplement(data) {
  return request({
    url: '/project/implement/save',
    method: 'post',
    data: data
  })
}

// 分页查询
export function listImplement(query) {
  return request({
    url: '/project/implement/list',
    method: 'get',
    params: query
  })
}



//查询详细信息
export function getImplement(id) {
  return request({
    url: '/project/implement/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updateImplement(data) {
  return request({
    url: '/project/implement/update',
    method: 'put',
    data: data
  })
}

//删除
export function delImplement(id) {
  return request({
    url: '/project/implement/' + id,
    method: 'delete'
  })
}






// 新增
export function addAccounting(data) {
  return request({
    url: '/project/accounting/save',
    method: 'post',
    data: data
  })
}

// 查询
export function listAccounting(query) {
  return request({
    url: '/project/accounting/list',
    method: 'get',
    params: query
  })
}


// 检查有无待提交的
export function checkWait(query) {
  return request({
    url: '/project/accounting/checkWait',
    method: 'get',
    params: query
  })
}

export function listAccountingCustomer(query) {
  return request({
    url: '/project/accounting/listCustomer',
    method: 'get',
    params: query
  })
}





//查询详细信息
export function getAccounting(id) {
  return request({
    url: '/project/accounting/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updateAccounting(data) {
  return request({
    url: '/project/accounting/update',
    method: 'put',
    data: data
  })
}

export function updateNewInfo(data) {
  return request({
    url: '/project/accounting/setNewInfo',
    method: 'put',
    data: data
  })
}

// 修改状态 
export function updateAudit(data) {
  return request({
    url: '/project/accounting/audit',
    method: 'put',
    data: data
  })
}

//删除
export function delAccounting(id) {
  return request({
    url: '/project/accounting/' + id,
    method: 'delete'
  })
}


// 查询总成本
export function getTotalCost(query) {
  return request({
    url: '/project/accounting/getTotalCost',
    method: 'get',
    params: query
  })
}

// 查询总成本 起始日期和截止日期内的
export function getTotalCostByDate(query) {
  return request({
    url: '/project/accounting/getTotalCostByDate',
    method: 'get',
    params: query
  })
}



// 查询总的 核算环节填写的质保金
export function getWarrantyMoney(query) {
  return request({
    url: '/project/accounting/warrantyMoney',
    method: 'get',
    params: query
  })
}



// 新增用户配置
export function saveUserTableConfig(data) {
  return request({
    url: '/project/projectInfo/saveUserTableConfig',
    method: 'post',
    data: data
  })
}

// 获取用户配置
export function getUserTableConfig(query) {
  return request({
    url: '/project/projectInfo/getUserTableConfig',
    method: 'get',
    params: query
  })
}



// 新增
export function addWarranty(data) {
  return request({
    url: '/project/warranty/save',
    method: 'post',
    data: data
  })
}

// 查询
export function listWarranty(query) {
  return request({
    url: '/project/warranty/list',
    method: 'get',
    params: query
  })
}



//查询详细信息
export function getWarranty(id) {
  return request({
    url: '/project/warranty/details',
    method: 'get',
    params: { id: id } // 查询参数
  });
}

// 修改
export function updateWarranty(data) {
  return request({
    url: '/project/warranty/update',
    method: 'put',
    data: data
  })
}

//删除
export function delWarranty(id) {
  return request({
    url: '/project/warranty/' + id,
    method: 'delete'
  })
}